package GUI;
import java.awt.Color;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import Controllers.LoginController;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.Font;

/**
 * The Class ReportsGUI.
 * Boundary for reports creating activity.
 */
public class ReportsGUI extends AbstractPanelGUI {
	
	/** The button sale responses report. */
	private JButton btnSaleResponsesReport;
	
	/** The button customers characterization report. */
	private JButton btnCustomersCharacterizationReport;
	
	/** The sid text field. */
	private JTextField sidTf;
	
	/** The button back. */
	private JButton btnBack;
	
	/**
	 * Instantiates a new reports gui.
	 */
	public ReportsGUI() {
		initialize();
	}
	
	/* (non-Javadoc)
	 * @see GUI.AbstractPanelGUI#initialize()
	 */
	@Override
	public void initialize() {
		LoginController.mainWindow.setTitle("Reports");
		setBackground(Color.ORANGE);
		setLayout(null);
		setSize(Width,Height);
		
		btnSaleResponsesReport = new JButton("Sale responses report");
		btnSaleResponsesReport.setBounds(120, 87, 230, 58);
		add(btnSaleResponsesReport);
		
		btnCustomersCharacterizationReport = new JButton("Customers characterization report");
		btnCustomersCharacterizationReport.setBounds(98, 204, 286, 58);
		add(btnCustomersCharacterizationReport);
		
		JLabel lblProduceSaleResponses = new JLabel("Produce sale responses report:");
		lblProduceSaleResponses.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblProduceSaleResponses.setBounds(130, 31, 221, 14);
		add(lblProduceSaleResponses);
		
		sidTf = new JTextField();
		sidTf.setBounds(195, 56, 105, 20);
		add(sidTf);
		sidTf.setColumns(10);
		
		JLabel lblSaleId = new JLabel("sale id:");
		lblSaleId.setBounds(140, 56, 148, 14);
		add(lblSaleId);
		
		JLabel lblProduceCustomersCharacterization = new JLabel("Produce customers characterization report:");
		lblProduceCustomersCharacterization.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblProduceCustomersCharacterization.setBounds(78, 178, 310, 14);
		add(lblProduceCustomersCharacterization);
		
		btnBack = new JButton("Back");
		btnBack.setBounds(10, 318, 89, 23);
		add(btnBack);
		
	}

	/**
	 * Gets the button sale responses report.
	 *
	 * @return the button sale responses report
	 */
	public JButton getBtnSaleResponsesReport() {
		return btnSaleResponsesReport;
	}

	/**
	 * Sets the button sale responses report.
	 *
	 * @param btnSaleResponsesReport the new btn sale responses report
	 */
	public void setBtnSaleResponsesReport(JButton btnSaleResponsesReport) {
		this.btnSaleResponsesReport = btnSaleResponsesReport;
	}

	/**
	 * Gets the button customers characterization report.
	 *
	 * @return the button customers characterization report
	 */
	public JButton getBtnCustomersCharacterizationReport() {
		return btnCustomersCharacterizationReport;
	}

	/**
	 * Sets the button customers characterization report.
	 *
	 * @param btnCustomersCharacterizationReport the new button customers characterization report
	 */
	public void setBtnCustomersCharacterizationReport(
			JButton btnCustomersCharacterizationReport) {
		this.btnCustomersCharacterizationReport = btnCustomersCharacterizationReport;
	}
	
	/**
	 * Adds action listener to sale responses report button.
	 *
	 * @param listener the listener
	 */
	public void addSaleResponseReportListener(ActionListener listener)
	{
		btnSaleResponsesReport.addActionListener(listener);
	}
	
	/**
	 * Adds action listener to customer characterization report button.
	 *
	 * @param listener the listener
	 */
	public void addCustomerCharaReportListener(ActionListener listener)
	{
		btnCustomersCharacterizationReport.addActionListener(listener);
	}
	
	/**
	 * Adds action listener to back button.
	 *
	 * @param listener the listener
	 */
	public void addBackListener(ActionListener listener)
	{
		btnBack.addActionListener(listener);
	}
	
	/**
	 * Gets the sid text field.
	 *
	 * @return the sid text field
	 */
	public JTextField getSidTf() {
		return sidTf;
	}

	/**
	 * Sets the sid text field.
	 *
	 * @param sidTf the new sid text field
	 */
	public void setSidTf(JTextField sidTf) {
		this.sidTf = sidTf;
	}
	
}
